@import "../styles/variables.scss";
@import "../styles/mixins.scss";

.layout-wrapper {
  display: flex;
  width: 100%;
  height: 100vh;
  background-color: $bg-color;

  .layout-sider {
    width: 280px !important;
    min-width: 280px !important;
    height: 100%;
    background: linear-gradient(180deg, $primary-dark 0%, $primary-color 100%);
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.15);
    transition: none !important;
    overflow: hidden;

    .logo {
      height: 60px;
      padding: 0 20px;
      display: flex;
      align-items: center;
      justify-content: center;
      border-bottom: 1px solid rgba(255, 255, 255, 0.1);
      margin-bottom: 8px;

      h1 {
        color: #fff;
        font-size: $font-size-lg;
        margin: 0;
        margin-left: 12px;
        font-weight: 600;
      }
    }

    .menu {
      padding: 8px 0;
      background: transparent !important;
      border-right: none !important;

      .ant-menu-item,
      .ant-menu-submenu {
        margin: 4px 12px;
        border-radius: 8px;
        transition: all 0.3s ease;
        position: relative;

        &:hover {
          background-color: rgba(255, 255, 255, 0.12) !important;
          transform: translateX(2px);
        }

        &.ant-menu-item-selected {
          background-color: rgba(255, 255, 255, 0.2) !important;
          color: #fff !important;
          box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
        }

        .anticon {
          color: rgba(255, 255, 255, 0.85);
          font-size: 16px;
          margin-right: 12px;
          transition: all 0.3s ease;
        }

        .ant-menu-title-content {
          color: rgba(255, 255, 255, 0.85);
          font-size: 14px;
          font-weight: 500;
          transition: all 0.3s ease;
        }

        &:hover .anticon,
        &:hover .ant-menu-title-content {
          color: #fff;
        }
      }

      .ant-menu-submenu {
        .ant-menu-submenu-title {
          color: rgba(255, 255, 255, 0.85);
          font-size: 14px;
          font-weight: 500;
          border-radius: 8px;
          transition: all 0.3s ease;

          .ant-menu-submenu-arrow {
            color: rgba(255, 255, 255, 0.6);
            transition: all 0.3s ease;

            &::before,
            &::after {
              background: rgba(255, 255, 255, 0.6);
            }
          }

          &:hover .ant-menu-submenu-arrow {
            color: #fff;

            &::before,
            &::after {
              background: #fff;
            }
          }
        }

        .ant-menu-sub {
          background: rgba(0, 0, 0, 0.15) !important;
          border-radius: 8px;
          margin: 4px 0 4px 8px;
          padding: 4px 0;
          border-left: 2px solid rgba(255, 255, 255, 0.1);
          position: relative;

          .ant-menu-item {
            margin: 1px 6px;
            padding: 0 12px;
            height: 32px;
            line-height: 32px;
            border-radius: 6px;
            position: relative;
            font-size: 13px;
            font-weight: 400;

            &:hover {
              background-color: rgba(255, 255, 255, 0.1) !important;
              transform: translateX(3px);
            }

            &.ant-menu-item-selected {
              background-color: rgba(255, 255, 255, 0.2) !important;
              color: #fff !important;
              box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
            }
          }

          .ant-menu-sub {
            margin: 2px 0 2px 6px;
            padding: 2px 0;

            .ant-menu-item {
              margin: 1px 4px;
              padding: 0 10px;
              height: 28px;
              line-height: 28px;
              font-size: 12px;

              &:hover {
                transform: translateX(2px);
              }
            }
          }
        }

        &.ant-menu-submenu-open {
          > .ant-menu-submenu-title {
            background-color: rgba(255, 255, 255, 0.08) !important;
          }
        }
      }
    }
  }

  .layout-header {
    height: 60px;
    padding: 0 24px;
    background: #fff;
    border-bottom: 1px solid $border-color;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);

    .header-left {
      display: flex;
      align-items: center;
      gap: 16px;

      .ant-breadcrumb {
        font-size: $font-size-md;
        color: $text-color-secondary;
      }
    }

    .header-right {
      display: flex;
      align-items: center;
      gap: 16px;

      .user-info {
        display: flex;
        align-items: center;
        gap: 8px;
        cursor: pointer;
        padding: 4px 8px;
        border-radius: 4px;
        transition: all 0.3s ease;

        &:hover {
          background-color: $hover-color;
        }

        .avatar {
          width: 32px;
          height: 32px;
          border-radius: 50%;
          background-color: $primary-color;
          color: #fff;
          display: flex;
          align-items: center;
          justify-content: center;
          font-size: $font-size-lg;
        }

        .username {
          font-size: $font-size-md;
          color: $text-color;
        }
      }

      .logout-btn {
        color: $text-color-secondary;
        font-size: $font-size-md;
        cursor: pointer;
        padding: 4px 8px;
        border-radius: 4px;
        transition: all 0.3s ease;

        &:hover {
          color: $primary-color;
          background-color: $hover-color;
        }
      }
    }
  }

  .layout-content {
    flex: 1;
    padding: 24px;
    overflow: auto;
    background-color: $bg-color;

    .content-wrapper {
      min-height: 100%;
      background-color: $bg-color-secondary;
      border-radius: $border-radius;
      box-shadow: $box-shadow;
    }
  }
}

.breadcrumb {
  font-weight: 500;
  color: $text-color;
}

.ant-tooltip {
  .ant-tooltip-inner {
    background-color: rgba(0, 0, 0, 0.85);
    color: #fff;
    font-size: 12px;
    border-radius: 4px;
    padding: 6px 8px;
  }

  .ant-tooltip-arrow {
    &::before {
      background-color: rgba(0, 0, 0, 0.85);
    }
  }
}
